#ifndef MYINETD_H
#define MYINETD_H

#define FOREVER          while(1)
#define MAX_NUM_SERVICES 100
#define RUNNING_DIR	 "/home/daniel/mc823/lab-redes-2s2011/tp05/"
#define LOCK_FILE	 "059878072627.lock"
#define LOG_FILE	 "myinetd.log"
#define CONF_FILE        "myinetd.conf"
#define MAX_LINE_SIZE    500
#define MAX_ARGS_SIZE    10
#define BACKLOG          10
#define MAX_ERR_MSG      100

typedef struct {
  int pid;
  int id;
  int sockfd;
} Connection;

typedef struct {
  char line[MAX_LINE_SIZE];
  char *name;    
  unsigned int port;
  int type;
  int protocol;
  int wait;
  char *pathname;
  int argc;
  char *args[MAX_ARGS_SIZE];
  int sockfd;
  Connection connection[BACKLOG];
} Service;

void log_message(char *filename, char *message);

extern char err_message[];

#endif /* MYINETD_H */
